#include "EntityCamera.h"
#include "includes.h"

EntityCamera::EntityCamera(void)
{
	cam.lookAt(Vector3(0,250,250),Vector3(0,0,0), Vector3(0,1,0)); //position the camera and point to 0,0,0
	cam.setPerspective(70,WINDOW_WIDTH/(float)WINDOW_HEIGHT,0.1,10000); //set the projection, we want to be perspective
}


EntityCamera::~EntityCamera(void)
{

}
void EntityCamera::update(float dt){

	Matrix44 gm = getGlobalMatrix();
	cam.center = gm * Vector3();
    cam.eye = (cam.eye*0.75)+(gm*Vector3(0,15,3)*0.25); 
    cam.eye = ((cam.eye- cam.center).normalize()*10) + cam.center;
    cam.up = cam.up * 0.9 + gm.rotateVector(Vector3(0,0,1))*0.1;

}
void EntityCamera::render(){
	cam.set();

}
